package com.hp.staticproxy;

public class TestProxy {

    public static void main(String[] args) {
        //创建工厂对象
        CellphoneSales factory = new CellphoneFactory();
        //创建代理商对象
        CellphoneSales shop = new CellphoneShop(factory);
        //调用方法
        shop.sell("华为");

        //创建工厂对象
        ComputerSales factory1 = new ComputerFactory();
        //创建代理商对象
        ComputerSales shop1 = new ComputerShop(factory1);
        //调用方法
        shop.sell("苹果");
    }
}
